
// import Home from '@/pages/Home'
// import Login from '@/pages/Login'
// import Register from '@/pages/Register'
// import Search from '@/pages/Search'
// import Detail from '@/pages/Detail'
// import AddCartSuccess from '@/pages/AddCartSuccess'
// import ShopCart from '@/pages/ShopCart'
// import Pay from '@/pages/Pay'
// import PaySuccess from '@/pages/PaySuccess'
// import Trade from '@/pages/Trade'
// import Center from '@/pages/Center'
// 3. 设置路由信息
 const routes =  [
    {
      name:'home',
      path:'/home',
      component:() => import ('@/pages/Home'),
      meta:{
        isHiddenNav:true //初始home隐藏
      }
    },
    {
      name:'login',
      path:'/login',
      component:() => import ('@/pages/Login'),
      meta:{
        isHiddenFooter:true
      }
    },
    {
      name:'register',
      path:'/register',
      component:() => import ('@/pages/Register'),
      meta:{  // 路由元信息 来添加自定义的属性存储一些信息等等
        isHiddenFooter:true
      }
    },
    {
      name:'search',
      path:'/search/:keyword?',
      component:() => import ('@/pages/Search')
    },
    {
      name:'detail',
      path:'/detail/:id?',
      component:() => import ('@/pages/Detail'),
      props:true //在组件内可以使用props的方式获取对应的params参数
    },
    {
      name:'addCartSuccess',
      path:'/addCartSuccess',
      component:() => import ('@/pages/AddCartSuccess')
    },
    {
      name:'shopCart',
      path:'/shopCart',
      component:() => import ('@/pages/ShopCart')
    },
    {
      name:'pay',
      path:'/pay',
      component:() => import ('@/pages/Pay')
    },
    {
      name:'paySuccess',
      path:'/paySuccess',
      component:() => import ('@/pages/PaySuccess')
    },
    {
      name:'trade',
      path:'/trade',
      component:() => import ('@/pages/Trade')
    },
    {
      name:'center',
      path:'/center',
      component:() => import ('@/pages/Center')
    },
    {
      path:'/',
      redirect:'/home'
      // component:Home
    }
  ]
  export default routes